﻿-- =============================================
-- Author:		Mauro Buccioli
-- Create date: 
-- Description:	
-- =============================================
CREATE PROCEDURE [dbo].[GetNullPrivacyListForGuest] 
	-- Add the parameters for the stored procedure here
	@GuestId int = 0
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	SELECT PL.[PrivacyId]
      ,[Name]
      ,[Text]
      ,[IsMandatory]
      ,[IsMandatoryAccept]
	FROM [SmartHotel].[dbo].[PrivacyList] PL
	LEFT JOIN SmartHotel.dbo.GuestPrivacyList GPL
	ON PL.PrivacyId = GPL.PrivacyId
	WHERE GPL.GuestId = @GuestId AND GPL.PrivacyId IS NULL
END